<?php
return array(
    '_id' => 'login',
    '_form' => array(
        'method' => 'post',
        'class' => array(),
        'accept-charset' => 'utf-8',
        'role' => 'form',
        'id' => 'login',
    ),
    'user' => array(
        'label' => '用户',
        'userOptions' => array(),
        'error' => '',
        'description' => '用户名或者邮箱',
        'widget' => 'Text',
        'attributes' => array(
            'class' => 'form-control',
        ),
        'filter' => ['safeFilter'],
        'validate' => [
            [
                'v' => 'StringLength',
                'min' => 3,
                'max' => 20,
            ],
        ],
        'required' => true,
    ),
    'password' => array(
        'label' => '密码',
        'userOptions' => array(),
        'error' => '',
        'description' => '登陆密码',
        'widget' => 'Password',
        'attributes' => array(
            'class' => 'form-control',
        ),
        'filter' => ['safeFilter'],
        'validate' => [
            [
                'v' => 'Regex',
                'pattern' => '^[a-z0-9A-Z_#]{1,}$',
                'message' => '验证码由字母数字 _ # 组成',
            ],
            [
                'v' => 'StringLength',
                'max' => 12,
                'min' => 8,
            ],
        ],
        'required' => true,
    ),
    '_options' => array(
        'save' => '\Modules\User\Library\Common::login',
        'error' => '登陆失败',
        'success' => '登陆成功'
    ),
);
